/**
 * Filename: MemberActivity.java
 *
 * @author Firefly
 * @contact postfirefly@163.com
 * @time 2016/3/6 14:45
 */
package com.github.postsanf.yinian.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;

import com.github.postsanf.yinian.BaseActivity;
import com.github.postsanf.yinian.R;

public class PuzzleWebActivity extends BaseActivity implements View.OnClickListener {
    private WebView puzzle_webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.yn_activity_puzzleweb);
        initView();
    }

    private void initView() {
        findViewById(R.id.puzzle_web_back).setOnClickListener(this);
        findViewById(R.id.puzzle_web_do).setOnClickListener(this);
        puzzle_webView = (WebView) findViewById(R.id.puzzle_webView);
        puzzle_webView.getSettings().setDefaultTextEncodingName("utf-8");
        puzzle_webView.getSettings().setJavaScriptEnabled(true);
        String url = "http://wx.zhuiyinanian.com/playpuzze?userid=" + application.getCurID();
        puzzle_webView.loadUrl(url);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.puzzle_web_back:
                finish();
                break;
            case R.id.puzzle_web_do:
                startActivity(new Intent(PuzzleWebActivity.this, LocalPuzzleManageActivity.class));
                break;
        }
    }
}